package com.qf.homework.service;

import com.qf.homework.aop.anno.Retry;
import com.qf.homework.common.RetryException;
import com.qf.homework.entity.User;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.math.BigDecimal;

@Service
@Scope("prototype")
public interface UserService {
    //登录
    public User login(String account,String password);
    //取钱
    @Transactional(rollbackFor = RetryException.class)
    @Retry
    public void getMoney(String account, BigDecimal money) throws InterruptedException;
    //新增用户
    public int addUser(User user);
}
